module.exports = {
  printWidth: 120, // 一个通用的默认行宽
  useTabs: false, // 统一使用空格
  semi: true, // 统一使用分号

  overrides: [
    {
      // --- 前端技术栈 ---
      files: ['app/frontend/**/*.{js,ts,vue,css,scss,html}', '*.{js,ts}'],
      options: {
        printWidth: 100,
        tabWidth: 2,
        singleQuote: true,
        trailingComma: 'all',
        bracketSpacing: true,
        arrowParens: 'always',
        bracketSameLine: false,
      },
    },
    {
      // --- Java 后端 ---
      files: 'app/backend/**/*.java',
      options: {
        printWidth: 180,
        tabWidth: 4,
        singleQuote: false,
        trailingComma: 'none',
      },
    },
    {
      // --- XML 文件 (例如 pom.xml) ---
      files: '**/*.xml',
      options: {
        printWidth: 120,
        tabWidth: 4,
        xmlWhitespaceSensitivity: 'ignore',
      },
    },
    {
      // --- YAML 文件 ---
      files: '**/*.{yml,yaml}',
      options: {
        tabWidth: 2,
        singleQuote: false,
      },
    },
    {
      // --- JSON ---
      files: '**/*.json',
      options: {
        tabWidth: 2,
        singleQuote: false,
      },
    },
    {
      // --- Markdown ---
      files: '**/*.md',
      options: {
        tabWidth: 4,
        singleQuote: false,
        proseWrap: 'preserve',
      },
    },
  ],

  // --- 3. 插件列表 ---
  plugins: [
    '@prettier/plugin-xml',
    'prettier-plugin-java',
    'prettier-plugin-tailwindcss',
    'prettier-plugin-classnames',
    'prettier-plugin-merge',
  ],
};
